package com.yanze.customviewdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RadioGroup;

import com.yanze.customviewdemo.widget.Bezier2;

public class BezierActivity extends AppCompatActivity {

    private Bezier2 bezier2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bezier);

        initView();
    }

    private void initView() {
        bezier2 = findViewById(R.id.bezier2);
        RadioGroup rg_control = findViewById(R.id.rg_control);
        rg_control.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                bezier2.setMode(checkedId == R.id.rb_1);
            }
        });
    }

    public static void start(Context context) {
        context.startActivity(new Intent(context,BezierActivity.class));
    }
}
